package com.dhcc.bpm.common.utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(description= "返回响应数据")
public class ResultAPI {
    @ApiModelProperty(value = "状态码")
    private Head Head;
    @ApiModelProperty(value = "数据")
    private Object Body;


    public com.dhcc.bpm.common.utils.Head getHead() {
        return Head;
    }

    public void setHead(com.dhcc.bpm.common.utils.Head head) {
        Head = head;
    }

    public Object getBody() {
        return Body;
    }

    public void setBody(Object body) {
        Body = body;
    }


    public ResultAPI(com.dhcc.bpm.common.utils.Head head, Object body) {
        Head = head;
        Body = body;
    }

    private ResultAPI() {}

    public static ResultAPI success() {
        ResultAPI resultAPI = new ResultAPI();
        resultAPI.setHead(com.dhcc.bpm.common.utils.Head.success());
        return resultAPI;
    }

    public static ResultAPI success(Object Body) {
        ResultAPI resultAPI = new ResultAPI();
        resultAPI.setHead(com.dhcc.bpm.common.utils.Head.success());
        resultAPI.setBody(Body);
        return resultAPI;
    }

    public static ResultAPI error(String msg) {
        ResultAPI resultAPI = new ResultAPI();
        resultAPI.setHead(com.dhcc.bpm.common.utils.Head.error(msg));
        return resultAPI;
    }

}
